/*
 * @Author: ayun chengyunwu@jiatui.com
 * @Date: 2023-07-17 17:49:20
 * @LastEditors: ayun chengyunwu@jiatui.com
 * @LastEditTime: 2023-07-19 11:55:34
 * @FilePath: /ift-economy-network-h5/src/pages/InvestmentScheduling/components/BasicInformation/index.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { useEffect, useState } from 'react'
import ListGroup, { ListGroupItem } from '../ListGroup'
import { getProjectInfo } from '@/service/InvestmentScheduling'

export type PropsT = {
  id?: string | null
}

const index = ({ id }: PropsT) => {
  const [dataInfo, setDataInfo] = useState<any>({})

  // 获取详情
  const getDetails = async () => {
    const res = await getProjectInfo({
      projectName: id,
      statDate: "2023-07"
    })
    console.log(res);
    setDataInfo({ ...res.data.data })
  }

  useEffect(() => {
    getDetails()

    return () => { }
  }, [])

  return (
    <>
      <ListGroup>
        <ListGroupItem title="国家编码" paragraph={dataInfo.countryCode} />
        <ListGroupItem title="行业类别" paragraph={dataInfo.industryCode} />
        <ListGroupItem title="项目类别" paragraph={dataInfo.xmlx} />
        <ListGroupItem title="资金来源" paragraph="dsaildjalksdjalksdals" />
        <ListGroupItem title="建设阶段" paragraph={dataInfo.buildStage} />
        <ListGroupItem title="建设起止年限" paragraph="dsaildjalksdjalksdals" />
        <ListGroupItem
          title="建设单位/业主单位"
          paragraph={dataInfo.backFillTime}
        />
      </ListGroup>
      <ListGroup>
        <ListGroupItem
          title="用地面积(平方米)"
          paragraph="dsaildjalksdjalksdals"
        />
        <ListGroupItem
          title="建设面积(平方米)"
          paragraph={dataInfo.floorage}
        />
      </ListGroup>
      <ListGroup>
        <ListGroupItem title="责任部门" paragraph={dataInfo.responsibleUnit} />
        <ListGroupItem title="所属街道" paragraph={dataInfo.ssjd} />
        <ListGroupItem title="具体地址" paragraph={dataInfo.projectAddress} />
      </ListGroup>
    </>
  )
}

export default index
